import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import redis
import time
city_dict={'bj':'beijing','nj':'nanjing','sh':'shanghai','gz':'guangzhou','sz':'shengzhen'}
city=city_dict[sys.argv[1]]
type=sys.argv[2]
db_type=sys.argv[3]
key="%s_%s" % (city, type)
print key
tbl="noti_es_%s" % db_type
print tbl
rc = redis.Redis(host='101.200.81.152', port=6380,db=8,password='zhugeZHAOFANG1116')
rc.hset(tbl, key, '1')
noti_es=rc.hget(tbl, key)
print noti_es
if (noti_es=='1'):
    print 'notify es succeed'
else:
    print 'notify es failed'
    sys.exit(1) 


